<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        {{message}}<br>
        {{reverseMessage}}<br>
        <button @click="change">改变</button>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            message:'hello'
        },
        methods:{
            change:function(){
                this.message='zhangsan';
            }
        },
        computed:{
            reverseMessage:function(){
                return this.message.split('').reverse().join('');
            }
        }
    });
</script>